<?php
	include "../utils/_connection.php";
	$var = conectar();
	session_start();

	$id = $_SESSION['id'];
	$id_co = $_GET['id'];

	$sql = "SELECT * FROM coauthors WHERE id_coauthor ='$id_co' ";
	$res = mysql_query($sql);
	$obj = mysql_fetch_object($res);

?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="">
	<title>Consola: Co-Author</title>

	<!-- Le styles -->
	<script type="text/javascript" src="../js/tinymce/tinymce.min.js"></script>
	<script type="text/javascript">
		tinymce.init({
			mode : "specific_textareas",
			editor_selector : "mceEditor",
			plugins: "table, code, image, jbimages",
			content_css: "css/content.css",
			invalid_elements: "span",
    //encoding: "xml",
    apply_source_formatting : true,
    relative_urls: 'false'
});
	</script>

	<script>
	    function submitForm(action)
	    {
	        document.getElementById('Form').action = action;
	        document.getElementById('Form').submit();
	    }
	</script>


	<link href="../css/bootstrap.css" rel="stylesheet">
	<style type="text/css">
		body {
			padding-top: 60px;
			padding-bottom: 40px;
		}
		.sidebar-nav {
			padding: 9px 0;
		}

		@media (max-width: 980px) {
			/* Enable use of floated navbar text */
			.navbar-text.pull-right {
				float: none;
				padding-left: 5px;
				padding-right: 5px;
			}
		}
	</style>

</head>

<body>

	<?php
	include 'include/header.php';
	?>

	<div class="container">
		<?php 
			include 'include/side.php';
		?>	

		<div class="col-sm-9">
			<div class="hero-unit">
				<form method="post" id="Form" action="coauthor_update.php?id=<?php echo $obj->id_coauthor;?>">

					<div class="page-header">
						<h3>Nombre</h3>
					</div>
					<div class="form-group">
						<div class="col-md-9"> 
							<input class="form-control" name="name" id="name" value=<?php echo "'".$obj->name."'"; ?> >
						</div>
					</div>
					</br>
					<div class="page-header">
						<h3>Degree</h3>
					</div>
					<div class="form-group">
						<div class="col-md-9"> 
							<input class="form-control" name="degree" id="degree" value=<?php echo "'".$obj->degree."'"; ?> >
						</div>
					</div>
					</br>
					<div class="page-header">
						<h3>Centro</h3>
					</div>
					<div class="form-group">
						<div class="col-md-9"> 
							<input class="form-control" name="center" id="center" value=<?php echo "'".$obj->center."'"; ?> >
						</div>
					</div>
					</br>
					<div class="page-header">
						<h3>Biografia</h3>
					</div>
					<div class="textarea">
						<p><textarea name="bios" id="bios" rows="5" class="form-control"><?php echo $obj->bios; ?></textarea></p>
					</div>


					<p>
						<button  class="btn btn-danger"> Enviar </button>
					</p>
				</form>
			</div>
		</div>
	</div><!--/row-->

	<!--Le Separator -->
	<hr>

	<?php
		include 'include/footer.php';
	?>	

</div><!--/.fluid-container-->

<?php
include 'include/scripts.php';
?>

</body>
</html>
